import React from 'react'
import PropTypes from 'prop-types'
import moment from 'moment'

function Main ({ value }) {
  let r = '无'
  if (value) {
    try {
      r = moment(value * 1000).format('YYYY-MM-DD')
    } catch (e) {
      console.warn(e.message)
    }
  }
  return <span>{r}</span>
}

Main.proptypes = {
  value: PropTypes.number
}

Main.defaultProps = {
  value: undefined
}

export default Main
